home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_inf_puzzlevator.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  104 lines

  1. # Jones 3D Cog Script
  2. #
  3. # INF_ChapelDoor.cog
  4. #
  5. #
  6. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  7. #
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message        startup
  13.     message     blocked
  14.     message     entered
  15.  
  16.     keyframe    in_pull=in_pull_lever_down.key    local
  17.     keyframe    lever_down=gen_lever.key        local
  18.     keyframe    elevanim=inf_elvtr_gears.key    local
  19.     keyframe    elevanimup=inf_elvtr_gearup.key    local
  20.           
  21.     sound       leverpull=nub_lever_pull_c.wav  local   
  22.     sound       leverback=nub_lever_reset_c.wav local
  23.     sound       gearplatmove=nub_weight_move_c.wav  local
  24.     sound       gearplatstart=nub_elev_start_c.wav  local
  25.     sound       gearplatstop=nub_elev_stop_c.wav    local
  26.     
  27.     surface     upvatorsurf0
  28.     surface     upvatorsurf1  
  29.  
  30.     thing        player                            local
  31.  
  32.     thing        camera
  33.     thing       camera_tgt0
  34.     thing       elevator
  35.     thing       elevator_cap
  36.     
  37.     thing       waypoint0
  38.     thing       waypoint1
  39.     
  40.     int         keychan                         local
  41.     int         movechan                        local
  42.     int         startchan                       local
  43.     int         screen=0                        local
  44.     int         checkit=0                       local
  45.  
  46. end
  47.  
  48. # ================================================================================
  49.  
  50. code
  51.  
  52. # ................................................................................
  53.  
  54. startup:
  55.  
  56.     AttachThingToThing(elevator_cap, elevator);
  57.     AISetMoveSpeed(elevator, 0.65);
  58.     AISetMoveFrame(elevator, 2);
  59.     player = GetLocalPlayerThing();
  60.     SetCollideType(elevator, 0);
  61.     ClearThingFlags(elevator, 0x80000);
  62.     
  63. return;
  64.  
  65. # ................................................................................
  66.  
  67. entered:
  68.  
  69.     if ((GetSenderRef() == elevator_cap) && (checkit == 0))
  70.     {
  71.         checkit = 1;
  72.         ClearAdjoinFlags(upvatorsurf0, 0x2);
  73.         ClearAdjoinFlags(upvatorsurf1, 0x2);
  74.         Sleep(0.5);
  75.         startchan=PlaySoundThing(gearplatstart, elevator, 1, 10, 20, 0x0080);
  76.         WaitForSound(startchan);
  77.         AISetMoveSpeed(elevator, 0.65);
  78.         AISetMoveFrame(elevator, 0);
  79.         keychan = PlayKey(elevator, elevanim, 2, 0x00, 0);
  80.         movechan = PlaySoundThing(gearplatmove, elevator, 1, 5, 10, 0x0081);
  81.         AIWaitForStop(elevator);
  82.         SetAdjoinFlags(upvatorsurf0, 0x2);
  83.         SetAdjoinFlags(upvatorsurf1, 0x2);
  84.         StopKey(elevator, keychan, 0.2);
  85.         StopSound(movechan, 0);
  86.         PlaySoundThing(gearplatstop, elevator, 1, 10, 20, 0x0080);
  87.     }
  88.     
  89. return;
  90.         
  91. # ................................................................................
  92.  
  93. blocked:
  94.  
  95.     //print("I'm blocked");
  96.     
  97. return;
  98.  
  99. # ................................................................................
  100.  
  101.  
  102. end
  103.  
  104.